export const getToken = () => {
  let obj = uni.getStorageSync("login-token");
  obj = JSON.parse(obj || null);
  if (obj && obj.expire && new Date() < new Date(obj.expire)) {
    return obj.token;
  }
  return "";
};

export const saveToken = (token, expire) =>
  uni.setStorageSync("login-token", JSON.stringify({ token, expire }));

export const removeToken = () => uni.removeStorageSync("login-token");
